<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>商品修改</title>
  <link rel="stylesheet" href="../../../files/css/layui.css" media="all"> 
	<link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">  
	<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
	<script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
	#goodsImg{
		position: relative;
		left:110px;
		
	}
	.layui-input-block .layui-input{
		width:300px;
	}
</style>
</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>会员修改列表</legend>
</fieldset>
 
<form class="layui-form" action="../../../shop/saveOrUpdate.action" method="post"  enctype="multipart/form-data">
	<input type="hidden" id="orderId" name="orderId">
   <div class="layui-form-item">
    <label class="layui-form-label">店家名称</label>
    <div class="layui-input-block">
      <input type="text" name="shopName" id="shopName" lay-verify="required" placeholder="请输入" autocomplete="off"   class="layui-input" readonly="readonly">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">用户名称</label>
       	<div class="layui-input-block">
      		<input type="text" name="linkman" id="linkman" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
    	</div>
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">联系电话</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="phone" id="phone"  autocomplete="off" class="layui-input">
      </div>
    </div>
  </div>
   <p>&nbsp;</p>
  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">地址</label>
    <div class="layui-input-block">
      <textarea placeholder="请输入内容" name="shopSite" class="layui-textarea"></textarea>
    </div>
  </div>
  
  <div class="layui-form-item">
	    <div class="layui-inline">
		    <label class="layui-form-label">店家类型:</label>
		   	<div class="layui-input-inline" id="goods">
				<select name="typeId" id="typeId" lay-verify="required" lay-search="">
		          <option value="">------选择类型------</option>
		        </select>
			</div>
	    </div>
	</div>
  
    <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">配送费</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="text" name="shopCote" id="shopCote"  autocomplete="off" class="layui-input">
      </div>
    </div>
  </div>
  
   <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">是否有效</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="number" name="isva" id="isva"  autocomplete="off" class="layui-input">
      </div>
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">是否排序</label>
      <div class="layui-input-inline" style="width: 100px;">
        <input type="number" name="sort" id="sort"  autocomplete="off" class="layui-input">
      </div>
    </div>
  </div>
  
   <div class="layui-form-item">
    <div class="layui-inline"> 
    	<img alt="" src="" id="fileName" name="fileName">
       <input type="file" name="image" id="image">
    </div>
  </div>
 
  <div class="layui-form-item">
    <div class="layui-input-block">
      <input type="submit" class="layui-btn" lay-submit="" lay-filter="goodsUpdate" value="立即提交">
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
</form>
  

<script src="../../../files/js/layui.js"></script>
<script type="text/javascript" src="../../../files/js/jquery.min.js"></script>
<script type="text/javascript" src="../../../commom/js/base.js"></script>
<script>
layui.use(['form','tree', 'layer'], function(){
  var form = layui.form
  ,layer = layui.layer
  ,$ = layui.$;
  form.on('submit(goodsUpdate)',function(){
	  layer.msg('数据加载中', {
		  icon: 1,
		  time: 1000 //2秒关闭（如果不配置，默认是3秒）
		}, function(){
			//进行渲染
			parent.location.reload(); // 父页面刷新
		});
	  
  });
  /* var url="GoodsServlet";
  var data= {action:'tree'};
  $.post(url,data,function(data){
	  eval("var data="+data);
	  layui.tree({
		  elem: '#goodsTypeTree' //传入元素选择器
		  ,nodes: data
		  ,click: function(node){
			 $("#goodType").val(node.name);
			 
			 $("#goodTypeId").val(node.id);
		  }  
		});
  }); */
  
  $.ajax({
	   async:false,
	  url:getRootPath()+'type/findAll.action',
  	  data:null,
  	  dataType:'JSON',
  	  success:function(msg){
  		  for(var i = 0;i<msg.length;i++){
  			$("#typeId").append("<option value="+msg[i].typeId+">"+msg[i].typeName+"</option>");
			form.render('select');
  		  }
  	  }
  	
  })
  layer.msg('数据加载中', {
	  icon: 1,
	  time: 10 //2秒关闭（如果不配置，默认是3秒）
	}, function(){
		//进行渲染
		form.render();
	});
});
</script>

</body>
</html>